{extend name="index_layout"/}
{block name="main"}
<link href="__STATIC__/admin/css/cloud-zoom.css"  rel="stylesheet" type="text/css">
<link href="__STATIC__/admin/css/main.css"  rel="stylesheet" type="text/css">
<script src="__STATIC__/admin/js/jquery.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/cloud-zoom.1.0.2.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/jquery-1.6.1.min.js"></script>
<script src="__STATIC__/admin/js/jquery.artZoom.js"></script>
<link href="__STATIC__/admin/css/jquery.artZoom.css" rel="stylesheet" type="text/css">
<div class="layui-card">
    <div class="layui-card-header">申请详情</div>
    <div class="layui-card-body">
        <!--<form class="layui-form form-horizontal" action="{:url('admin/applyhelp/info')}" method="post">-->
            <input type="hidden" name="id" id="id" value="{$data.id}" />
            <input type="hidden" name="level" id="level" value="{$data.level}" />
            <input type="hidden" id="route" value="0" />
        <div class="layui-form-item">
            <label class="layui-form-label">等级</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.level}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">申请人账号</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.username}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">申请人是否是党员</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.is_dang}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">帮扶状态</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.status_name}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">审核人</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.eName}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-inline">
                <textarea autocomplete="off" disabled style="width: 200%;height: 50px;">{$data.type}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.name}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">民族</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.nation}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.sex}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">出生年月日</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.born_date}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.mobile}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属单位</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.danwei}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属支部</label>
            <div class="layui-input-inline">
                <textarea autocomplete="off" disabled style="width: 200%;height: 50px;">{$data.zhibu}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工作单位地址</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.work_address}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工作单位详细地址</label>
            <div class="layui-input-inline">
                <textarea autocomplete="off" disabled style="width: 200%;height: 50px;">{$data.work_address_info}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入党时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.rudang_date}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">基本情况</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.msg}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">基本情况详情</label>
            <div class="layui-input-inline">
                <textarea autocomplete="off" disabled style="width: 200%;height: 50px;">{$data.msg_info}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">申请时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.create_time}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">审核通过时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.pass_time}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">完成时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$data.finish_time}" autocomplete="off" class="layui-input" disabled>
            </div>
        </div>
        <div id="hideImg" style="display:none;width: 40%;height: 500px;position:absolute;left:30%;z-index:99; "></div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证正面照</label>
                    <a href="{$data.upImg}" rel="{$data.upImg}">
                        <img style="width: 200px;height: 150px" class="artZoom" src="{$data.upImg}" >
                    </a>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证反面照</label>
                    <a href="{$data.downImg}" rel="{$data.downImg}">
                        <img style="width: 200px;height: 150px" class="artZoom" src="{$data.downImg}" >
                    </a>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">补充资料(点击获取大图)</label>
                <ul>
                    {notempty name="data.buchong"}
                        {volist name="data.buchong" id="vo" key="k"}
                        <li style="{if $k != 0}margin-left: 110px;{/if}">
                            <a href="{$vo}" rel="{$vo}">
                                <img style="width: 200px;height: 150px" class="artZoom" src="{$vo}" >
                            </a>
                        </li>
                        {/volist}
                    {else /}
                        无
                    {/notempty}
                </ul>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    {if $data.type == 1}

                        {if $data.status == 3}
                        <button class="layui-btn layui-btn-danger pass" >通过</button>
                        <button class="layui-btn layui-btn-danger refuse" >拒绝</button>
                        {/if}

                        {if $data.status == 4}
                        <button class="layui-btn layui-btn-danger finish" >归档</button>
                        {/if}
                    {else/}

                        {if $data.status == 0}
                        <button class="layui-btn layui-btn-danger sendHelp" >指派</button>
                        {/if}
                        {if $data.status == 2}
                        <button class="layui-btn layui-btn-danger pass" >通过</button>
                        <button class="layui-btn layui-btn-danger fail" >拒绝</button>
                        {/if}
                        {if $data.status == 3}
                        <button class="layui-btn layui-btn-danger sendHelp" >归档</button>
                        {/if}
                    {/if}

                    <button class="layui-btn layui-btn-normal return" >返回</button>
                </div>
            </div>
        <!--</form>-->
    </div>
</div>
{/block}
{block name="script" }
<!--<script type="text/javascript" src="__STATIC__/admin/js/common.js"></script>-->
<script type="text/javascript">

        $(".return").click(function () {
            var level = $("#level").val();
            if(level == "普通"){
                window.open('{:url("admin/applyhelp/index")}','_self');
            }else{
                window.open('{:url("admin/applyhelp/indexUrgent")}','_self');
            }
        });

        $(".pass").click(function () {
            var id = $("#id").val();
            window.open('{:url("admin/applyhelp/makeSure")}' + "?id=" + id, '_self')
        });
        $(".refuse").click(function () {
            var id = $("#id").val();
            layer.open({
                type: 2,
                title: '拒绝申请',
                shadeClose: true,
                shade: 0.8,
                area: ['50%', '80%'],
                content: '/admin/applyHelp/fail?id='+id    //直接显示某个页面的内容
            });
        });

        $(".sendHelp").click(function () {
            var id = $("#id").val();
            layer.open({
                type: 2,
                title: '指派帮助人',
                shadeClose: true,
                shade: 0.8,
                area: ['50%', '80%'],
                content: '/admin/applyHelp/helpMember?id='+id    //直接显示某个页面的内容
            });
        });

        $(".finish").click(function () {
            layer.confirm('确定归档此条申请？', { icon: 3, title: '提示' }, function(index) {
                layer.close(index);
                $.post('{:url("admin/applyhelp/finish")}', { 'id': data.id }, function(data) {
                    if (data.code == 1) {
                        if (data.url) {
                            layer.msg(data.msg + ' 页面即将自动跳转~');
                        } else {
                            layer.msg(data.msg);
                        }
                        setTimeout(function() {
                            if (data.url) {
                                location.href = data.url;
                            } else {
                                location.reload();
                            }
                        }, 1500);
                    } else {
                        layer.msg(data.msg);
                        setTimeout(function() {
                            if (data.url) {
                                location.href = data.url;
                            }
                        }, 1500);
                    }

                });
            });
        });

        jQuery(function ($) {
            $('.artZoom').artZoom({
                path: './images',	// 设置artZoom图片文件夹路径
                preload: true,		// 设置是否提前缓存视野内的大图片
                blur: true,			// 设置加载大图是否有模糊变清晰的效果

                // 语言设置
                left: '左旋转',		// 左旋转按钮文字
                right: '右旋转',		// 右旋转按钮文字
                source: '看原图'		// 查看原图按钮文字
            });

            $('#myEmail').html(1987 + '.tangbin@' + 'gmail.com');
        });

		 // $("#hideImg").click(function () {
        //     var current = $("#route").val();
			// $("#route").val(parseInt(current)+90);
        //     current = parseInt(current)+90;
			// this.style.transform = 'rotate('+current+'deg)';
        // });


        function previewImg(obj) {
            var current = $("#route").val();
            console.log(1111);
            $("#route").val(parseInt(current)+90);
            current = parseInt(current)+90;
            this.style.transform = 'rotate('+current+'deg)';
        }

</script>
{/block}